local skill = fk.CreateSkill({
  name = "xy__sijue",
})

local spec = {
  anim_type = "masochism",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skill.name) and data.card.trueName == "slash"
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
      if not player:isKongcheng() then
        local card1=room:askToChooseCards(player, {
        target = player,
        min = 1,
        max = 1,
        flag = "h",
        skill_name = skill.name
        })
        room:throwCard(card1, skill.name, player, player)
      end
      if player == data.from then
        player:drawCards(player.hp - player:getHandcardNum(), skill.name)
      end
      if not data.from:isKongcheng() then
       local card=room:askToChooseCards(player, {
        target = data.from,
        min = 1,
        max = 1,
        flag = "h",
        skill_name = skill.name
      })
      room:throwCard(card, skill.name, data.from, player)
      if not player.dead and card  then
            for _, id in ipairs(card) do
                if player.dead  then break end
                local cards = Fk:getCardById(id)
                if (cards.type == Card.TypeBasic)then
                    room:askToUseRealCard(player, {
                        pattern = { id },
                        skill_name = skill.name,
                        extra_data = {
                        bypass_times = true,
                        expand_pile = { id },
                        extraUse = true,
                        },
                     })
                end
            end
        end
      end
      
    
    
        
  end,
}

skill:addEffect(fk.Damage, spec)
skill:addEffect(fk.Damaged, spec)


Fk:loadTranslationTable {
["xy__sijue"] = "死决",
[":xy__sijue"] = "当你因【杀】造成或受到伤害后，你可以弃置你与伤害来源各一张手牌，若其弃置了基本牌，你可以使用之；若你为伤害来源，你将手牌摸至体力值。",
["$xy__sijue1"] = "",
["$xy__sijue2"] = "",
}
return skill  --不要忘记返回做好的技能对象哦